home *** CD-ROM | disk | FTP | other *** search
- /*
- This script is to eleminate invalid charcaters that will cause sometimes on
- an AMIGA unexpected result. BareED allows to use any characters in range
- from 1 to 255, but some applications (e.g. gcc - the GNU C compiler) have
- got problems with it. So this script will exchange the characters from 1 to
- 8, 11 to 26, 28 to 31 and 128 to 159 through a simple string, e.g.
- '»»replaced number 25 through this««'.
- */
-
- BAREED_HOST = GetClip('BAREED')
-
- IF BAREED_HOST = '' THEN DO
- CALL SetClip('BAREED') /* Remove from ClipNode */
- EXIT 5
- END
-
- ADDRESS VALUE BAREED_HOST
-
- CALL SetClip('BAREED') /* Remove from ClipNode */
-
- OPTIONS RESULTS
-
- /* ------------------- MAIN ---------------- */
-
- 'set echo off'
- activate window
- lock on
-
- repchar = 1
- reps = 0
- set findmode
-
- tell "Going to replace invalid strings."'0a'x"This can take its time."'0a'x'0a'x"Please have patience."
-
- do while repchar < 32
- set find string d2c( repchar)
- set replace string "»»replaced number" repchar "through this««"
- move cursor archivestart
-
- do while rc = 0
- if repchar == 9 | repchar == 10 | repchar == 27 then /* Ignore tab, lf and esc */
- break
- find next string
- if rc = 0 then do
- replace next
- reps = reps + 1
- end
- end
-
- repchar = repchar + 1
- end
-
- repchar = 128
-
- do while repchar < 160
- set find string d2c( repchar)
- set replace string "»»replaced number" repchar "through this««"
- move cursor archivestart
-
- do while rc = 0
- find next string
- if rc = 0 then do
- replace next
- reps = reps + 1
- end
- end
-
- repchar = repchar + 1
- end
-
- lock off
- tell "Replaced" reps "invalid (non AMIGA like) number(s) through string(s)."'0a'x"Those strings are introduced by the text: '»»replaced'"
-